{extend name="index@common/base"/} 
{block name="style"}
{/block} {block name="body"}
<div class="layui-body layui-tab-content index-body" id="cont">
	<div class="park-navigation">
		<div class="navigation-icon">
			<i class="fa {$breadCrumb[0]['icon']}"></i>
		</div>
		<div class="navigation-menu">
			<h2>{$breadCrumb[0]['title']}</h2>
			{if isset($breadCrumb[1])}
			<p>{$breadCrumb[0]['remark']}</p>
			{/if}
		</div>
	</div>
	<div class="park-content">
		<div class="content-title">
			<div class="title col-8">
				<h3>{$breadCrumb[1]['title']}</h3>
				<form class="layui-form" action="{:url('inspection/mission/search')}" onsubmit="return false;">
					<button class="search-btn" lay-submit lay-filter="search"><img src="__STATIC__/img/base/topsearch01.png"></button>
					<input class="search-input" name="keyword" type="text" placeholder="任务名称" id="keyword"  autocomplete="off">
					<select name="enterpriseId">
						<option value="">单位</option>
						{volist name="enterpriseList" id="item"}
						<option value="{$key}">{$item}</option>
						{/volist}
					</select>
				</form>	
			</div>
			<div class="tool col-2">
				<button id="add" data-url="{:url('inspection/mission/add')}"><i class="fa fa-plus"></i></button>
				<button id="reload"><i class="fa fa-refresh"></i></button>
			</div>
		</div>
		<div class="layui-content" lay-accordion id="missionTable" data-url="{:url('inspection/mission/index')}">
                    
   		</div>
    	<div id="page"></div>
	</div>
</div>
{/block}
{block name="script"}

<script type="text/javascript" src="__JS__/inspection/mission.js"></script>

 <script id="tableTemplate" type="text/html">
	
        {{# for(var i = 0;i < d.length; i++){ }}
		<div class="maintab">
        <table class="mission-table">
           	<thead>
			<tr>
                <th>企业:{{d[i].enterprise.fullName}}</span></th>
                <th>巡检区域：<small>{{d[i].areaId}}</small></th>
                <th style="text-align:center;">
					<a class="layui-btn btn-config config-item"  data-url="{:url('inspection/mission/configItem')}?missionId={{d[i].id}}"><i class="fa fa-cogs"></i></a>
					<a class="layui-btn btn-edit edit-mission"  data-url="{:url('inspection/mission/edit')}?missionId={{d[i].id}}"><i class="fa fa-pencil"></i></a>
  					<a class="layui-btn btn-del del-mission" data-url="{:url('inspection/mission/del')}?missionId={{d[i].id}}"><i class="fa fa-trash"></i></a>
				</th>
            </tr>
			</thead>
			<colgroup>
                 <col width="25%">
                 <col width="50%">
				 <col width="20%">
            </colgroup>
			<tbody>
  				<tr>
                 	<td>{{d[i].title}}</td>
                 	<td colspan="2">{{d[i].rangeDesc}}</td>
            	</tr>
			</tbody>
        </table>
        {{# if(d[i].items != null){ }}
            <div class="maintab">
                <table class="item-table detail-table">
                    <colgroup>
                        <col width="20%">
                 		<col width="50%">
				 		<col width="20%">
				 		<col width="5%">
                    </colgroup>
                    <tbody>
                        {{# for(var j = 0;j < d[i].items.length; j++){ }}
                        <tr>
                            <td>
                                <p><b>巡检点：</b>{{d[i].items[j].patrolPoint}}</p>
                                <p><b>检查项目：</b>(<span style="color: red">{{d[i].items[j].importance}}</span>)</p>
                                <p>{{d[i].items[j].inspectItem}}</p>
                            </td>
                            <td>
                                <p><b>检查内容：</b> &nbsp;{{d[i].items[j].inspectContent}}</p>
                                <p><b>检查标准：</b> &nbsp;{{d[i].items[j].inspectStandard}}</p>
                                <p><b>检查对象：</b> &nbsp;{{d[i].items[j].inspectionObject}}</p>
                            </td>
                            <td>
                                <p><b>巡查周期：</b> &nbsp;{{d[i].items[j].cycleId}}</p>
                                <p><b>检查方法：</b> &nbsp;{{d[i].items[j].inspectMethod}}</p>
                                <p><b>参考资料：</b> &nbsp;{{d[i].items[j].referenceMaterial==null?'':d[i].items[j].referenceMaterial}}</p>
                            </td>
                            <td>
                                <span><a class="layui-btn btn-del detach-item" data-url="{:url('inspection/mission/detach')}?missionId={{d[i].id}}&itemId={{d[i].items[j].id}}"><i class="fa fa-trash"></i></a></span>
                            </td>
                        </tr>
                         {{# } }}
                    </tbody>
                </table>
            </div>
          {{# } }}
		</div>
      {{# } }}
    </script>
{/block}

